package com.da.javatest.leetCode;

/**
 * @author chenlida
 * @date 2019/1/12 15:06
 * @description
 */
public class Code667 {
    public int[] constructArray(int n, int k) {
        int[] result = new int[n];
        result[0] = 1;
        result[1] = 1 + k;
        for (int i = 2; i < n; i++) {
            if (k < i) {
                result[i] = i + 1;
            } else {
                result[i] = i;
            }
        }
        return result;
    }
}
